#ifndef QUERYFORM_H
#define QUERYFORM_H

#include <QtGui>
#include <QtNetwork>

namespace Ui {
    class QueryForm;
}

class SuggestCompletion;
class QueryForm : public QWidget {
    Q_OBJECT
public:
    QueryForm(QWidget *parent = 0);
    ~QueryForm();
	QString From();
	QString To();
	static QString Beautifulize(const QString & Text);

private:
    Ui::QueryForm *m_ui;
	QHttp * m_SuggestHttp;
	SuggestCompletion * m_Completer;
	QMap<int, QLineEdit *> m_Map;
	void Suggest(QString Text, QLineEdit * Edit);

signals:
	void Query(const QString & From, const QString & To, const QString & Date);

private slots:
	void on_pushButton_pressed();
 void on_SearchButton_pressed();
	void OnSuggestSrc(QString From);
	void OnSuggestDst(QString To);
	void OnSuggestPageFinished(int Id, bool _Error);
};

#endif // QUERYFORM_H
